package com.atguigu.lease.model.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;

@Getter //为枚举类的属性提供getter方法
@Schema(description = "公寓房间类型枚举类")
public enum ItemType implements BaseEnum {
    APPARTMENT(1,"公寓"),
    ROOM(2,"房间");



    @JsonValue //jackson转换为json字符串时，会使用标注的属性 值当做枚举对象的值
    @EnumValue //只在mp生成sql时生效，表示使用标注的属性当做枚举对象的值！！
    private Integer code;
    private String name;
    private ItemType(Integer code, String name) {
        this.code = code;
        this.name = name;
    }
}
